define(window.backboneCommon.getControllerDefine("Strategy"), function (require,Model,ModelBaseData,ModelCampaign,ModelSpread,ModelSpace,ModelTargetPack,ModelReport) {
    var model=new Model();
    var modelBaseData=new ModelBaseData();
    var modelCampaign=new ModelCampaign();
    var modelSpread=new ModelSpread();
    var modelSpace=new ModelSpace();
    var modelTargetPack=new ModelTargetPack();
    var modelReport=new ModelReport();
    return Backbone.Collection.extend({
        model:  model,
        initialize: function () {
            model.set({modelBaseData:modelBaseData});
            model.set({modelCampaign:modelCampaign});
            model.set({modelSpread:modelSpread});
            model.set({modelSpace:modelSpace});
            model.set({modelTargetPack:modelTargetPack});
            model.set({modelReport:modelReport});
        },
        initAfterDetail:function (campaignId) {
            this.getSpreadList(campaignId);
            modelBaseData.getDeliveryTimeType();
        },
        getPageList:function(param){
            model.getPageList(param);
        },
        updateStatus:function (param) {
            model.updateStatus(param);
        },
        updatePrice:function (param) {
            model.updatePrice(param);
        },
        getInfo:function(param){
            model.getInfo(param);
        },
        saveInfo:function (json) {
            json.id ? model.updateInfo(json) : model.addInfo(json);
        },
        getSpreadList:function(campaignId){
            modelSpread.getAllList(campaignId);
        },
        getCampaignInfo:function (id) {
            modelCampaign.getInfo(id);
        },
        getTargetPackList:function (param) {
            modelTargetPack.getAllList(param);
        },
        getTargetPackInfo:function (id) {
            modelTargetPack.getInfo(id);
        },
        getReport:function (type,param) {
            switch(type){
                case "hour":
                    modelReport.getListHourByStrategy(param);
                    break;
                case "day":
                    modelReport.getListDayByStrategy(param);
                    break;
            }
        }
    });
});